<template>
	<view id="box1">
		这是一个login组件
		这是父组件传递过来的值：{{title}}
		<button @click="sendMsg">给父组件进行传值</button>
	</view>
</template>

<script>
	export default {
		name:"login",
		props:["title"],
		data() {
			return {
				num:5
			};
		},
		beforeCreate(){
			console.log("初始化之后会被调用的beforeCreate..."+this.num)
		},
		created(){
			console.log("实例初始化完成后created..."+this.num)
		},
		beforeMount(){
			console.log("beforeMount:::"+document.getElementById("box1"))
		},
		mounted(){
			console.log("mounted:::")
			console.log(document.getElementById("box1"))
		},
		destroyed(){
			console.log("实例被销毁了...")
		},
		methods:{
			sendMsg(){
				this.$emit("myEvent",this.num)
			}
		}
	}
</script>

<style>

</style>
